import {getCurrentInstance, onMounted, reactive} from "vue";
const result = reactive({
    code:0,
    message:"",
    data:"",
    success: true,
    timestamp:""
})
const post = function (url, body) {
    export default {
        setup() {
            const currentInstance = getCurrentInstance();
            const { $axios } = currentInstance.appContext.config.globalProperties;
            const getData = async () => {
                const response = await $axios({ url: url ,method: "post",});
                page.data = response.data;
                console.log("data", page);
                console.log("data1", page.data);
            };
            onMounted(() => {
                getData()
            });

            return { page };
        },
    };
}